// 阻止Vue在启动时生成生产提示
Vue.config.productionTip = false;
new Vue({
	el: "#root",// 用于指定当前Vue实例在为哪个容器服务,通常为css选择器 也可以写为 document.getElementById("root")
	data: {// data用于存储数据,数据供el指定的容器使用,
		keyword: "",
		students: [
			{id: 1, name: "马冬梅", age: 19, sex: "女"},
			{id: 2, name: "周冬雨", age: 20, sex: "女"},
			{id: 3, name: "周杰伦", age: 21, sex: "男"},
			{id: 4, name: "温兆伦", age: 22, sex: "男"},
		],
	},
	computed: {
		fiStudents() {
			return this.students.filter(item => item.name.indexOf(this.keyword) !== -1)
		}
	},
	methods: {}
});
